package web_pro;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class xcx_user {
	private String YH_ID="";
    private String YH_NAME="";
    private String YH_PHONE="";
    
    public String getYH_ID() {
		return YH_ID;
	}
	public void setYH_ID(String yH_ID) {
		YH_ID = yH_ID;
	}
	public String getYH_NAME() {
		return YH_NAME;
	}
	public void setYH_NAME(String yH_NAME) {
		YH_NAME = yH_NAME;
	}
    public String getYH_PHONE() {
			return YH_PHONE;
		}
		public void setYH_PHONE(String yH_PHONE) {
			YH_PHONE = yH_PHONE;
		}
		
	
	public String xcx_yhlist() {
		Connection  conn = pub_fun.getConnection();
    	String Sql_str = "select * from xcx_yhlist order by YH_ID ";
		String json01="[";
    	try {
			PreparedStatement pstat = conn.prepareStatement(Sql_str);
			ResultSet rs = (ResultSet) pstat.executeQuery();
			while(rs.next())  
	            {
						json01= json01+"{\"YH_ID\":\""+rs.getString("YH_ID") +"\",\"YH_NAME\":\""+rs.getString("YH_NAME")+"\",  \"YH_PHONE\":\""+rs.getString("YH_PHONE")+"\"},";		
				}
			json01=json01+"]";
	        pstat.close();
	        conn.close();

 
        } catch (SQLException e) {
            e.printStackTrace();
        }
    	json01 = json01.replace("},]", "}]");
		return json01;
	}
	

}
